package com.pussinboots.morning.sync.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pussinboots.morning.sync.entity.ErpProductView;
import com.pussinboots.morning.sync.entity.Product;
import com.pussinboots.morning.sync.entity.ProductAttribute;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 商品属性表 Mapper 接口
 * </p>
 *
 * @author BaoZhou
 * @since 2019-09-10
 */
@Repository
public interface ProductAttributeMapper extends BaseMapper<ProductAttribute> {
    /**
     * 根据productID更新记录
     * @param productList
     * @return
     */
    boolean updateStockBatchByProduct(@Param("productList")List<Product> productList);

    /**
     * 根据ErpId更新库存
     * @param erpProductList
     * @return
     */
    Integer updateStockBatchByErp(@Param("erpProductList")List<ErpProductView> erpProductList);

    /**
     * 根据productID批量删除
     * @param prodcutIdList
     * @return
     */
    boolean removeBatchByProductId(@Param("prodcutIdList")List<Long> prodcutIdList);

    /**
     * 根据ERPId批量删除库存
     * @param erpIds
     * @return
     */
    Integer delStockByErpId(@Param("erpIds") List<String> erpIds);
}